Repository navigation
feat(studio): a dashboard list's New opens the app's design mode on its dashboards - #37368
objectstack-fleet[bot] wants to merge 1 commit into
Conversation
…ts dashboards Studio's dashboard list New now opens the package's app (decision 6, the .custom pair leg included) with a one-time navigation-state arrival: ConsoleLayout reads it once, clears it from the history entry, and asks the design mode to enter with the Add menu item picker open on its dashboards. A refused entry does nothing more and says why; a phone does nothing. The dashboard created there opens for editing with ?studio= back to the list. The list offers no New at phone width, and none without a target app, saying why. The report New is unchanged. Claude-Session: https://claude.ai/code/session_01QSeKYoLfUxK6MRhuSp7nAt Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
| leg | mutation | result at head |
|---|---|---|
| A1′ | mode.enterOpening(…) → mode.enter() in useDesignModeArrival |
3 red (DesignModeMenu-36363) |
| A3 | navigate without withStudioReturn |
1 red |
| A5 | if (heldOut.current > 0) → if (false) |
4 red (36363 + 36362) |
| A6 | AreaCreate's dashboard branch → if (false) |
5 red (StudioAreaAppOpen-36906) |
| A6p | StudioAreaAppOpen's if (phone) fallback → if (false) |
2 red |
| A7 | readNewDashboardSegment pair leg true → false |
3 red (36906 + 36897) |
| A8 | useStudioDashboardNew reads no phone |
1 red |
| A9 | canCreate = canCreateHere |
3 red |
| AP | if (enabled) mode.enterOpening( → if (true) … |
green 56/56 (N2) |
| A4′ | the clearing navigate's replace: true → replace: false |
green 56/56 (N2) |
Check-runs at head. There are 58 runs: 45 success, 13 skipped, 0 failed, 0 pending. l1-face judges all 13 skips expected. Lint & Repo Gates and TypeScript Type Check are success, and so are Test UI, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, the Dogfood Regression Gate aggregate, Check Changeset, PR-body guards and the Governed Surface Queue Guard. No dogfood is owed: there is no ! and no (narrowing) arm.
Merge-tree and overlap.
- Against current
origin/main15a5be1d,git merge-tree --write-treeexits 0. None of main's 8 commits sinced5ae7a47touches a file in this PR. - feat(console): a 「⋯」 package menu in Studio's top bar; Import on Setup → Packages #37362 (
178bfae9) and feat(studio): 全部类型 All types ends the 高级 fold, and the type directory lists every type a package could hold #37380 (45ed0a4b) share onlystudio/en.tsandstudio/zh.ts. fix(app-shell): a new report from an app's reports list saves into the app's package, as a new view does #37357 (baa9e0e0) shares no file. None of the three touchesstudioAppEdit.tsorStudioAreaAppOpen.tsx. - Each merges cleanly on top of main + feat(studio): a dashboard list's New opens the app's design mode on its dashboards #37368 (a temporary merge commit, no ref written). The stack main + feat(studio): a dashboard list's New opens the app's design mode on its dashboards #37368 + feat(console): a 「⋯」 package menu in Studio's top bar; Import on Setup → Packages #37362 + feat(studio): 全部类型 All types ends the 高级 fold, and the type directory lists every type a package could hold #37380 also exits 0.
- Studio 重构(4-1):删掉分区路由和残留(:packageId/:tab 路由、AREA_PILLAR_FOR_TYPE、pillar 文案、旧 Studio 应用的菜单项) #36909's PR, now fix(studio): every retired pillar address lands on its new page in one redirect; the pillar-era code with no reader goes #37383 (
2322b402), sharesStudioMetadataArea.tsx. It merges cleanly on main + feat(studio): a dashboard list's New opens the app's design mode on its dashboards #37368.
K = 8. That is git rev-list --count 6fbbdd9b..origin/main at 15a5be1d. The zone's freeze read 6, and main has moved two commits since.
Size and tier. check-governed-merges.mjs --pr 37368: 0 of 15 paths are governed, and the PR has 941 changed lines (≤ 3000). It is not Tier H, so the zone lands it.
Contract review. None is owed. The PR declares Clause-②: no with no (narrowing) arm, touches no packages/spec/src/**, and touches no governed path. All 15 files are under ui/packages/** or .changeset/.
维护者速读 accuracy.
- Line 1 matches the pins and the browser walk.
- Line 2 matches 专题:Studio 重构——某个应用的开发界面:左侧按类型分组的菜单 → 列表 → 右侧全屏详情(去掉顶部分区) #36890 and the ruling 「新建跳到设计模式加菜单」. Its 「不会游离在所有菜单之外」 holds for the list's New; the area's own create is still reachable through the fallbacks (N1, N3).
- Line 3 is right: this is a pure front-end change and can be reverted.
- Line 4 「无」 is right for a Tier S landing.
- After S1's fix, Line 1 needs no change.
Findings
- S1 (should-fix) — On a phone, an empty Studio dashboard list in a writable package now says 「This type is read-only — instances are defined by code artifacts in packages.」
- Cause:
useStudioDashboardNewreturns'phone', socanCreateis false, and the empty-state description inResourceListPage.tsxfalls through:canCreate ? createHint : dashboardNew === 'no-app' ? dashboardNewNoApp : readOnlyHint. The Studio host sets noemptyListHintfor a package, and the dashboard config has noemptyStateHint. - The same false sentence also shows while
'pending'on desktop, for as long as the app read takes. - Measured: I ran a throwaway probe (a copy of the 36897 harness with an empty dashboard list, deleted afterwards). At 390 px it prints
["This type is read-only — instances are defined by code artifacts in packages"], and at 1280 px it printsClick "New" above to create the first Dashboard. Control: undercanCreate = canCreateHere, the 390 px reading is the create hint, as main has it. - It is a regression this PR introduces. On main the phone's list offered the area's own New with the create hint. It is false copy on a surface the card names.
- Fix:
- Don't fall through to
readOnlyHintfor'phone'or'pending'. Draw no description while pending. On a phone, draw no hint, or a short one that says a dashboard is made in an app's design mode on a wider screen (a new en/zh key instudio). - Pin the phone empty state's text in
ResourceListPage.pairCreate-36897, with an ablation that turns it red.
- Don't fall through to
- Cause:
- N1 — The Studio create route is a deep link into the arrival.
- Opening
/studio/<pkg>/metadata/dashboard/new?package=<pkg>directly lands in the app with the mode on. The new 36906 describe mounts exactly that URL. - It is the same shape Studio 重构(3-4):Studio 列表点仪表盘、报表,直接进应用里的编辑状态;× 回 Studio 列表;报表「新建」进 /apps/<应用>/reports/new #36906 shipped (a Studio item URL opens the app's edit state through
dashboardEditArrival;report/newopens the new-report page). The route is transient: it is replaced before it is shown, so it is not copied from the address bar. The card's "no address" is about the mode and the app page, and both hold. - The route is gated by Studio's
studio.accessandAreaCreate's!readOnly || pairCreate. It is not gated by the door'suseStudioEntryGate(workspace admin withmanage_metadata), nor by the list'swalled. The server judges every write again. This disposes of the report's out-of-scope finding (「the arrival does not repeat the door's own gate」) as Acceptance notes. - The changeset's 「a shared link … does not turn it on」 is true of the app's address. Accepted.
- Opening
- N2 — Two guards are unpinned on their own.
- AP (
if (enabled)dropped fromuseDesignModeArrival) stays green. The controller's ownenabledmasks it, and it differs only if a phone widens past 768 px with the opening held. - A4′ (push in place of replace) stays green. The read-once pin's 「reload」 leg mounts a fresh router with
state: null, which is the premise, not a result. Back to the arrival entry is never exercised. The dev's A4 (navigate removed) does go red. - Optional in S1's patch round. Not required.
- AP (
- N3 — On the cross-package leg (
?package=all,host.packageId === null),useStudioDashboardNewreturns'off'. That leg's New is still offered on a phone and for a package with no app, and it lands inAreaCreate's fallback, the area's own create. This is main's behaviour, not a regression, and the card names the package list. Noted. - N4 — The claim's file surface did not list
designMode.tsx,useDesignModeArrival.ts(new),ResourceListPage.tsxorStudioMetadataArea.tsx. All four carry card steps 1–3. The report names theStudioMetadataArea.tsxshare with Studio 重构(4-1):删掉分区路由和残留(:packageId/:tab 路由、AREA_PILLAR_FOR_TYPE、pillar 文案、旧 Studio 应用的菜单项) #36909 (PR fix(studio): every retired pillar address lands on its new page in one redirect; the pillar-era code with no reader goes #37383, merges clean), and the PR body names the others. No action. - N5 — The zone's Q2 B ruling (a pair's report New takes the pair leg, a small follow-up) is recorded only in comment 7179044983 on Studio 重构(3-4b):仪表盘列表的「新建」跳到应用的设计模式并直接打开「添加菜单项 → 仪表盘」(设计模式加一个到达入口) #36907, and
Fixes #36907closes that card on merge. Filing-gate: 「已落地工作欠的后续照立卡」. File it when the PR lands, asreview follow-ups of PR #37368(with N2 if not folded into S1), or carry it in the wind-down brief. - N6 — Evidence notes only. The report's
gateslists 「Test Core success; Dogfood Regression Gate success」. Those are the aggregates; their shards and Build Core are expected skips on this ui-only diff. The zone's K read 6, and it is 8 now. No action.
Next
- REWORK: one patch round through SendMessage to the original dev (
session_01QSeKYoLfUxK6MRhuSp7nAt), same claim and branch, for S1 (N2 optional). I will re-read the delta at the new head. - Once that delta is ACCEPTed, the zone lands it at Tier S. It is not governed, has 941 changed lines and owes no L2. K = 8 (< 15), so the zone does not need to merge main first. Re-read the check-runs at the landing head, and file N5 when it lands.
Fixes #36907
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The Studio dashboard list's New now uses design mode's existing 「Add menu item → New dashboard…」 flow (#36364), the maintainer's 「新建跳到设计模式加菜单」 (dashboard half). The report half (decision 13) is unchanged.
The arrival (
layout/designModeArrival.ts,layout/useDesignModeArrival.ts). A second navigation-state arrival,designModeAddDashboard, sits besidedesignModeNewDashboardand carries the Studio list it came from.ConsoleLayoutreads it once per history entry throughuseDesignModeArrival. It first replaces the entry without the arrival, so a reload or Back enters nothing. Then it asks the mode toenterOpening({ column: 'dashboard', studioReturn }).?studio=and no mode.enterOpeningisenterplus a one-shot "opening" held in the mode store. Whereenterrefuses (an editor holds the mode out, PR fix(console): report editing is its own entry, mutually exclusive with design mode #36848), nothing is held and the mode's owndesignMode.editorOpentoast says why. On a phone the arrival is cleared and nothing more happens.enter()keeps its zero-argument contract: a click event is never an opening.DesignModeMenutakes the opening once (useDesignModeOpening). It opens the picker on 「Dashboards」 for an entry at the end of the top level, as that level's 「Add menu item」 would. A dashboard created from that picker navigates withwithStudioReturn(href, studioReturn), so the dashboard page's existing × goes back to the Studio list (?studio=). Closing that picker drops the return, and later adds are plain.Studio (
StudioAreaAppOpen.tsx,studioAppEdit.ts,StudioMetadataArea.tsx).StudioAreaAppTargetgains{ kind: 'new-dashboard' }.AreaCreatesendsdashboard/newthrough it, under the same condition the report leg uses (!readOnly || pairCreate). It replaces the Studio address with/apps/SEGMENT(appHomePath) and the arrival.studioAppCreateSegment..custompair leg from fix(studio): a customization pair's dashboard or report opens in its base app's edit state #37348 applies: a pair with no app of its own reads its base's apps. That reading is factored intoreadStudioTargetApps, which the item leg now shares too.The list (
ResourceListPage.tsx).useStudioDashboardNewgates the area's dashboard 新建 by the same reads. It never shows at phone width, and it is not drawn while the apps are being read. With no target app the header shows no 新建 and shows arole="note"reason instead (engine.list.dashboardNewNoApp); the empty state says the same.Riders from seat 4's L1 on PR #37348.
StudioAreaAppOpen-36906test header now says a pair row opens in the base's app.Additive en and zh keys:
engine.list.dashboardNewNoAppin thestudionamespace (it is en/zh only). No server, spec or route change.Read first
ui/packages/app-shell/src/layout/useDesignModeArrival.ts: the consume-then-enter order. Risk: it navigates (replace) in the same commitAppRootLanding's redirect may navigate. Child effects run first, so the landing redirect re-applies on the next render; see Acceptance notes.ui/packages/app-shell/src/layout/designMode.tsx:enterWith/enterOpening/takeOpening, andheldOutmoving to a ref.ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen.tsx: thenew-dashboardleg anduseStudioDashboardNew.Tests
Pins, each with an ablation that turned it red (and restored hash-verified through
scripts/ablation-replace.mjs). Every file below imports the subject from source, so no build or dist preflight applies:StudioAreaAppOpen-36906(dashboard list's New…),DesignModeMenu-36363(the arrival…)AreaCreatedashboard branch off → 5 red; A1enterOpeningcall removed → 6 red; A2 picker kindnull→ 2 redDesignModeMenu-36363withStudioReturndropped → 1 redCONTROL — the report listResourceListPage.pairCreate-36897(dashboard list's 「新建」…)no-app→ 3 red; A10 reason not drawn → 2 redenter()does nothingDesignModeMenu-36363StudioAreaAppOpen-36906,ResourceListPage.pairCreate-36897DesignModeMenu-36363Moved by this change, and re-pinned rather than deleted:
Local runs on the final head 6fbbdd9 (rebased on d5ae7a4)
cd ui && npx vitest run --maxWorkers=2over the 4 pinned files (DesignModeMenu-36363,designMode-36362,StudioAreaAppOpen-36906,ResourceListPage.pairCreate-36897) givesTest Files 4 passed (4) · Tests 114 passed (114).pnpm --filter @object-ui/app-shell type-check(bothtsconfig.jsonandtsconfig.test.json) gives lockVERDICT command-exit 0.b0fc2e64, givingTest Files 156 passed (156) · Tests 1743 passed (1743). The rebase brought in one commit, fix(studio): a permission set's review link opens the draft review on its matrix page #37347, which touches none of this PR's files. The full app-shell suite (2,431 files) is left to CI'sTest UI(a declared narrowing).node scripts/pm/dispatch-gates.mjs --commands: all 38 commands exit 0, run onb0fc2e64.6fbbdd9b:pnpm check:test-source-aliasexit 0,pnpm --dir ui check:i18n-keysexit 0,node scripts/pm/overlap-check.mjsgivesVERDICT clean exit 0. It reports one open PR, feat(console): a 「⋯」 package menu in Studio's top bar; Import on Setup → Packages #37362, that shares the studio en/zh namespace files and merges cleanly.git merge-tree:claude/issue-37139-studio-package-menumerges clean.claude/issue-36909-studio-pillar-dead-codemerges clean. It sharesStudioMetadataArea.tsxwith this PR, in different hunks.Ablations (each through scripts/ablation-replace.mjs, restored, git diff HEAD empty)
enterOpeningcall inuseDesignModeArrival→DesignModeMenu-36363: 6 failed | 50 passed.setPickerKind(null)→ 2 failed.withStudioReturn→ 1 failed.navigate(..., { replace: true })→ 4 failed.if (false)in place of the held-out check → 2 failed.heldOutAtRender) → only "the same refusal when the editor opens in the very commit the arrival lands in" fails among this card's pins. The prior-editor pin stays green.AreaCreate's dashboard branch never taken →StudioAreaAppOpen-36906: 5 failed | 22 passed.readNewDashboardSegment→ 2 failed. A7b (list) →ResourceListPage.pairCreate-36897: 1 failed.useStudioDashboardNewreads no phone → 1 failed.canCreateignoresdashboardNew→ 3 failed.Acceptance notes
useDesignModeArrivalreplaces the history entry it read, in the same commitAppRootLandingmay redirect to the app's landing. Child effects run first, so the landing redirect re-applies on the next render. In the browser, the showcase landed on its first page (/page/showcase_capability_map) with the mode on andhistory.state.usr === null. A self-built app whose menu holds only links stays on/apps/ID, with the same result.areaskeeps its plain menu under design mode, becauseUnifiedSidebardraws the editor only whenareas.length === 0. That predates this PR. There the arrival enters the mode but no picker opens. No example app usesareas. See the report's open question.useStudioEntryGateand the customization wall). The Studio list's 新建 is already gated bycanCreate(walled,pairCreate), and the server judges every write again.designMode.tsx). Nothing rendered from it;enteris the only reader. The existing 36692 pins pass unchanged.Verification
pnpm dev -- --fresh -p 38461(seeded admin), and the Console fromui/sources viapnpm --filter @object-ui/console devon :5180 pointed at it. Driven with Playwright from a scratch script, not committed.com.example.showcase, a read-only code package; the HotCRM shape): Studio › dashboard list › 新建 lands on/apps/com.example.showcase/page/showcase_capability_mapwith the Design layout bar and the 「Add menu item」 picker on Dashboards (「New dashboard…」 first). The history entry's state was cleared./apps/com.example.showcase/dashboard/walk_showcase?studio=/studio/com.example.showcase/metadata/dashboard?package=com.example.showcasein its edit state, with the × drawn. The entry is in the menu, and the dashboard was saved tocom.example.showcase.custom.com.walk.selfbuilt, created throughPOST /api/v1/packageswith one appwalk_app): 新建 lands on/apps/com.walk.selfbuiltwith the bar and picker. Create opens/apps/com.walk.selfbuilt/dashboard/walk_selfbuilt?studio=…, and the dashboard was saved tocom.walk.selfbuilt. × returns to the list.com.walk.noapp): no 新建, and the note reads "A new dashboard is made in an app's design mode, so that it hangs in a menu. This package has no app to make it in."Generated by Claude Code